/* ruoyi/css/card.css */

/* 卡片容器 */
.ruoyi-card {
    height: 420px; /* 固定卡片总高度 */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

/* 图片容器固定宽高 */
.card-img-container {
    width: 100%;
    height: 200px; /* 固定图片区域高度 */
    overflow: hidden;
    position: relative;
}

/* 图片自适应 */
.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例填充 */
    transition: transform 0.3s;
}

/* 内容区域高度自适应 */
.card-body {
    padding: 1.25rem;
    flex: 1; /* 剩余空间由内容区域填充 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: 2rem;
    font-weight: 600;
    color: #540909;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 价格模块 */
.price-section {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.current-price {
    font-size: 2.25rem;
    color: #ff4d4f;
    font-weight: bold;
}

.original-price {
    color: #999;
    text-decoration: line-through;
}

/* 库存信息 */
.stock-info {
    color: #666;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 促销标签 */
.badge-promo {
    position: absolute;
    top: 12px;
    right: -30px;
    background: #ff4d4f;
    color: white;
    padding: 4px 30px;
    transform: rotate(45deg);
    font-size: 0.75rem;
    box-shadow: 0 2px 8px rgba(255,77,79,0.3);
}

/* 购买按钮 */
.btn-buy {
    width: 100%;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #ff6b6b, #ff4d4f);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,77,79,0.3);
}

/* 响应式布局 */
@media (max-width: 992px) {
    .card-body {
        padding: 1rem;
    }
    .current-price {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .ruoyi-card {
        margin-bottom: 1rem;
    }
    .card-title {
        -webkit-line-clamp: 3;
    }
}

.sold-out {
    background-color: gray!important;
    color: white!important;
}
